package com.systop.student.mapper;
import com.systop.common.pojo.Student;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface StudentMapper {
    /*
     * 登陆
     * Teacher
     * return int
     * csh
     * */
    @Select("select * from Student where sno = #{sno} and password= #{password}")
    Student studentLogin(Student student);
    /*
     * 修改
     * Teacher
     * return int
     * csh
     * */
    @Update("update Student set password = #{password},name = #{name},college_name = #{college_name}, grade = #{grade},class_name = #{class_name},remark = #{remark}  where sno = #{sno}")
    int updataStudent(Student student);


    //"time = #{time,jdbcType=TIMESTAMP} "  时间类型

    /*
     * 添加
     * Teacher
     * return int
     * csh
     * */
    @Insert("insert into Student(sno,password,name,college_name,grade,class_name,remark) values " +
                              "(#{sno},#{password},#{name},#{college_name},#{grade},#{class_name},#{remark})")
    int studentAdd(Student student);
    /*
     * 查看全部
     * 无
     * list
     * csh
     * */
    @Select("select * from Student")
    List<Student> studentSupList();

    /*
     * 用tno查看
     * String tno
     * list
     * csh
     * */
    @Select("select * from Student where sno = #{sno}")
    List<Student> studentSupList1(String sno);

    /*
     * 删除
     * string tno
     * return int
     * csh
     * */
    @Delete("delete from Student where sno=#{sno}")
    int delStudent(String sno);

}
